Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard otel errors #5193

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Discard otel errors #5193

merged 1 commit into from
Sep 6, 2024

Conversation

Warashi
Copy link
Contributor

@Warashi Warashi commented Sep 6, 2024

What this PR does / why we need it:

This PR discards all errors and logs from the otel library.
Without this PR, we will see error logs when an error occurs, like the one below.

2024/09/06 13:16:53 traces export: rpc error: code = PermissionDenied desc =

Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
Comment on lines +240 to +244
// if control plane's flag monitoring.enabled is false, otel provider logs errors.
// it's no problem but we don't want to see it.
// so we discard the errors and the logs.
otel.SetErrorHandler(otel.ErrorHandlerFunc(func(err error) {}))
otel.SetLogger(logr.Discard())
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have to set global ErrorHandler and Logger before we create the tracer providers.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 22.84%. Comparing base (e7c40a0) to head (90bc82c).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/app/piped/cmd/piped/piped.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5193      +/-   ##
==========================================
- Coverage   22.86%   22.84%   -0.02%     
==========================================
  Files         420      420              
  Lines       45247    45245       -2     
==========================================
- Hits        10344    10338       -6     
- Misses      34108    34112       +4     
  Partials      795      795              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ffjlabo ffjlabo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Warashi Warashi merged commit ac32fda into master Sep 6, 2024
15 of 17 checks passed
@Warashi Warashi deleted the gateway-ext-authz-uaex branch September 6, 2024 04:32
@github-actions github-actions bot mentioned this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants